package com.heima.common.exception;

import com.heima.model.common.enums.AppHttpCodeEnum;
import lombok.Data;

/**
 * @author Ronaldo
 * @date 2021/7/29
 */
@Data
public class LeadNewsException extends RuntimeException {

    private Integer code;

    public LeadNewsException(AppHttpCodeEnum appHttpCodeEnum) {
        super(appHttpCodeEnum.getErrorMessage());
        this.code = appHttpCodeEnum.getCode();
    }

    public LeadNewsException(AppHttpCodeEnum appHttpCodeEnum, Throwable throwable) {
        super(appHttpCodeEnum.getErrorMessage(), throwable);
        this.code = appHttpCodeEnum.getCode();
    }
}
